type cop = CAdd | CSub | CMult | CDiv | CEqual | CNeq | CLess | CLeq | CGreater | CGeq | CAnd | COr | CMod
type cdirection = CLedge | CRedge | CUedge
type ctype = CVoid | CInt | CFloat | CString | CDiGrNode | CDiGrEdge | CVector of ctype | CTypePointer of ctype

type cvar = 
  Cvar of string
| CArrayStat of string * int
| CArrayDyn of string * cvar
| CPointer of string

type cexpr =
    CLiteral_Int of int
  | CLiteral_Float of float
  | CLiteral_String of string
  | CActuals of cexpr list
  | CId of cvar
  | CBinop of cexpr * cop * cexpr
  | CCallNew of string * cexpr list
  | CCall of string * cexpr list
  | CObjCall of cvar * string * cexpr list
  | CIdAddr of string
  | CNoexpr

type csigvar = 
  CSigVar of ctype * string
| CSigVect of ctype * string
| CSigPtr of ctype * string
| CSigRef of ctype * string
| CSigArr of ctype * cvar
| CFuncFormal of ctype * string * ctype list

type cstmt =
    CTryCatchBlock of cstmt list
  | CBlock of cstmt list
  | CExpr of cexpr
  | CDeclare of csigvar
  | CDeclareAssign of csigvar * cexpr

  | CAssign of cvar * cexpr
  | CAssignRule of string * cexpr
  | CReturn of cexpr
  | CIf of cexpr * cstmt list * cstmt list
  | CWhile of cexpr * cstmt list
  | CDoWhile of cexpr * cstmt list
  | CPrint of cexpr list 

type cfunc_decl = {
    creturntype : ctype;
    cfname : string;
    cformals : csigvar list;
    cbody : cstmt list;
  }

type cprogram = cfunc_decl list
